<?php

class Admin_Form_Rol extends Zend_Form {

    public function init() {
        // Set the method for the display form to POST
        $this->setMethod('post');
        $this->setAttrib("id", "rol-form");
        //$this->setAction('/admin/rol/save');
        $this->setAttrib('class', 'form-horizontal mini-layout-body');
        $this->addElementPrefixPath('Admin', 'admin/');
        $this->addElement('hidden', 'codigo_rol');

        $this->addElement('text', 'nombre', array(
            'label' => 'Nombre:',
            'required' => true,
            'filters' => array('StringTrim'),
            'class' => 'input-block-level',
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(2, 50))
            )
        ));

        $this->addElement('button', 'save', array(
            'ignore' => true,
            'onclick' => 'guardar()',
            'label' => 'Guardar',
            'class' => 'btn btn-large btn-primary'
        ));

        $this->addElement('button', 'cancel', array(
            'ignore' => true,
            'label' => 'Cancelar',
            'onclick' => 'back()',
            'class' => 'btn btn-large btn-primary'
        ));
    }
}
?>
